package  com.java1234.util;

 // 读取Excel的类 
 import  java.io.File;

 import  jxl.Cell;
 import  jxl.Sheet;
 import  jxl.Workbook;

 public class text01  {
     public static String getExcel(){
    	 String result = null;
         try   {
            Workbook book  =  Workbook.getWorkbook( new File("D:\\eclipse-ee\\workspace\\.metadata\\.plugins\\org.eclipse.wst.server.core\\tmp0\\wtpwebapps\\studentManage\\upload\\2.xls" ));
             //  获得第一个工作表对象 
             Sheet sheet  =  book.getSheet( 0 );
             //  得到第一列第一行的单元格 
             Cell cell1  =  sheet.getCell( 0, 0);
            result  =  cell1.getContents();
            //System.out.println(result);
            book.close();
        }   catch  (Exception e)  {
            System.out.println(e);
        } 
         
         return result;
    } 
     public String GetExcel(){
    	 String result = null;
         try   {
            Workbook book  =  Workbook.getWorkbook( new File("D:\\eclipse-ee\\workspace\\.metadata\\.plugins\\org.eclipse.wst.server.core\\tmp0\\wtpwebapps\\studentManage\\upload\\2.xls" ));
             //  获得第一个工作表对象 
             Sheet sheet  =  book.getSheet( 0 );
             //  得到第一列第一行的单元格 
             Cell cell1  =  sheet.getCell( 0, 0);
            result  =  cell1.getContents();
            //System.out.println(result);
            book.close();
        }   catch  (Exception e)  {
            System.out.println(e);
        } 
         
         return result;
    } 
     
     public static void main(String[] args) {
    	 String excelData = text01.getExcel(); 
 		System.out.println(excelData);
	}
} 